"""
-*- coding: utf-8 -*-
@File  : flowraw2flow.py
@author: ZhenyuYang
@Time  : 2023/04/06 21:27
"""
import os
import shutil

if not os.path.exists("../data/flows"):
    os.mkdir("../data/flows")
label_list = os.listdir("../data/flows_raw")
for label in label_list:
    label_src_path = "../data/flows_raw/{}".format(label)
    label_dst_path = "../data/flows/{}".format(label)
    if not os.path.exists(label_dst_path):
        os.mkdir(label_dst_path)
    sub_list = os.listdir(label_src_path)
    for sub in sub_list:
        sub_src_path = "{}/{}".format(label_src_path, sub)
        sub_dst_path = "{}/{}".format(label_dst_path, sub)
        if not os.path.exists(sub_dst_path):
            os.mkdir(sub_dst_path)
        img_list = os.listdir(sub_src_path)
        for img in img_list:
            src = "{}/{}".format(sub_src_path, img)
            dst = "{}/img_{}".format(sub_dst_path, img)
            shutil.copyfile(src, dst)



